package com.tianaceae.educational.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tianaceae.educational.mapper.EduCourseMapper;
import com.tianaceae.educational.domain.EduCourse;
import com.tianaceae.educational.service.IEduCourseService;

/**
 * 教务课程Service业务层处理
 * 
 * @author zhouhonggang
 * @date 2023-03-30
 */
@Service
public class EduCourseServiceImpl implements IEduCourseService 
{
    @Autowired
    private EduCourseMapper eduCourseMapper;

    /**
     * 查询教务课程
     * 
     * @param id 教务课程主键
     * @return 教务课程
     */
    @Override
    public EduCourse selectEduCourseById(Long id)
    {
        return eduCourseMapper.selectEduCourseById(id);
    }

    /**
     * 查询教务课程列表
     * 
     * @param eduCourse 教务课程
     * @return 教务课程
     */
    @Override
    public List<EduCourse> selectEduCourseList(EduCourse eduCourse)
    {
        return eduCourseMapper.selectEduCourseList(eduCourse);
    }

    /**
     * 新增教务课程
     * 
     * @param eduCourse 教务课程
     * @return 结果
     */
    @Override
    public int insertEduCourse(EduCourse eduCourse)
    {
        eduCourse.setCreateTime(DateUtils.getNowDate());
        return eduCourseMapper.insertEduCourse(eduCourse);
    }

    /**
     * 修改教务课程
     * 
     * @param eduCourse 教务课程
     * @return 结果
     */
    @Override
    public int updateEduCourse(EduCourse eduCourse)
    {
        eduCourse.setUpdateTime(DateUtils.getNowDate());
        return eduCourseMapper.updateEduCourse(eduCourse);
    }

    /**
     * 批量删除教务课程
     * 
     * @param ids 需要删除的教务课程主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseByIds(Long[] ids)
    {
        return eduCourseMapper.deleteEduCourseByIds(ids);
    }

    /**
     * 删除教务课程信息
     * 
     * @param id 教务课程主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseById(Long id)
    {
        return eduCourseMapper.deleteEduCourseById(id);
    }
}
